package com.zmn.oms.business.interfaces.worktrack;

import com.zmn.base.oms.common.model.es.orderwork.EsWorkTrack;
import com.zmn.oms.model.entity.omstrack.OrderWorkTrack;
import com.zmn.oms.model.entity.work.OrderWork;
import com.zmn.oms.model.vo.work.OperatePermissionVO;

import java.util.Date;
import java.util.List;

/**
 * @ClassName OmsTrackService
 * @description:
 * @author: wangyanci
 * @create: 2021-05-12 18:18
 * @Version 1.0
 **/
public interface WorkTrackBService {

    void deleteAndAddTrack(OrderWorkTrack orderWorkTrack);

    OperatePermissionVO getOperatePermissionByTrack(Long orderId, Long workId);

    /**
     * 用户待取消状态
     *
     * @param orderId
     * @param workId
     * @return
     */
    Integer getUserWaitCancelStatus(Long orderId, Long workId);

    /**
     * 用户待取消状态
     *
     * @param orderId
     * @param workId
     * @return
     */
    Integer getUserWaitCancelStatusSrcMaster(Long orderId, Long workId);

    /**
     * 用户待取消状态
     *
     * @param trackList
     * @return
     */
    Integer getUserWaitCancelStatus(List<OrderWorkTrack> trackList);

    /**
     * 获取用户取消的跟单
     *
     * @param orderWork
     * @return
     */
    OrderWorkTrack getUserWaitCancelTrack(OrderWork orderWork);

    /**
     * 查询订单待取消状态-工程师列表或详情使用
     *
     * @param trackList
     * @return
     */
    Integer getMasterWaitCancelStatus(List<EsWorkTrack> trackList);

    /**
     * 查询订单待取消跟单-工程师列表或详情使用
     *
     * @param orderId
     * @param workId
     * @return
     */
    OrderWorkTrack getMasterWaitCancelTrack(Long orderId, Long workId);

    /**
     * 获取工程师待取消状态
     *
     * @param orderWork
     * @param orderWorkTrack
     * @return
     */
    Integer getMasterWaitCancelTrack(OrderWork orderWork, OrderWorkTrack orderWorkTrack);


    void trackChangeHandle(OrderWorkTrack track);

    /**
     * 根据用户取消类跟单创建时间获取自动取消时间
     */
    Date getAutoCancelTime(Date applyCancelDate);
}